package com.iwhalecloud.citybrain.flow.platform.manager.application.service.impl.task;

import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;

/**
 * @author lilh
 * @date 2019-03-07 13:55
 */
public class MultiInstanceTaskCreateListener implements TaskListener {

    private static final long serialVersionUID = 2847048827233893214L;

    private static final String NUMBER_OF_PASS_INSTANCES = "nrOfPassInstances";

    private static final String NUMBER_OF_UNPASS_INSTANCES = "nrOfUnpassInstances";

    @Override
    public void notify(DelegateTask delegateTask) {
        // 多人顺序的场景下，会覆盖掉已经处理过的人数
        // 在 MultiInstanceTaskCompleteListener 中会调整这个数值
        //delegateTask.setVariable(NUMBER_OF_PASS_INSTANCES, 0);
        //delegateTask.setVariable(NUMBER_OF_UNPASS_INSTANCES, 0);
    }
}
